package com.jiangsong.batch;

import lombok.extern.slf4j.Slf4j;
import org.springframework.batch.core.JobExecution;
import org.springframework.batch.core.JobExecutionListener;

@Slf4j
public class ProductJobListener implements JobExecutionListener {

    public ProductJobListener() {
        System.out.println("创建job了哦");
    }

    @Override
    public void beforeJob(JobExecution jobExecution) {
        log.info("before job execute");
        System.out.println("before job execute: " + jobExecution.getJobInstance().getJobName());
    }

    @Override
    public void afterJob(JobExecution jobExecution) {
        System.out.println("after job execute: " + jobExecution.getJobInstance().getJobName());
    }
}
